import CountUI from '../../components/Count/index'
// 引入Redux里的store
// import store from '../../redux/store'
// 
import {connect} from 'react-redux'
// 引入acrion
import {createIncrementAction,createDecrementAction,createIncrementAsyncAction} from '../../redux/count_action'

// 返回键值对儿，
const mapStateToProos = (state)=> {
    return {
        count : state
    }
}
// 返回函数
// 通知redux执行加法
const mapDispatchToProps = (dispatch)=> {
    return {
        jia : number  => dispatch(createIncrementAction(number)) , 
        jian : number  => dispatch(createDecrementAction(number)),
        jiaAsync: (number,time)  => dispatch(createIncrementAsyncAction(number,time))
    }
}
// 连接a,b.  b收到a传的参数
// connect 连接两个东西 将参数传递给UI组件（count)
export default connect(mapStateToProos,mapDispatchToProps)(CountUI)